<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title>接口测试</title>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
 </head>
 <script src="${request.contextPath}/static/assets/js/jquery.js"></script>
 <script src="${request.contextPath}/static/assets/js/jquery_extend.js"></script>
<script type="text/javascript">

$(document).ready(function(){
	 $("#submitBtn").click(function(){
		 $.get($("#serviceUrl").val(),
				{
			      serviceName:$("#serviceName").val(),
			      methodName:$("#methodName").val(),
			      paramterInput:$("#paramterInput").val()
				},
				function(data,status){
				     $("#invokeOnput").val(data);
		        }
		 );
	 });
	 
	 $("#loadBtn").click(function(){
		 $.get($("#loadUrl").val(),
				{
			      serviceName:$("#serviceName").val(),
			      methodName:$("#methodName").val()
				},
				function(data,status){
				     $("#paramterInput").val(data);
		        }
		 );
	 });
	 
	 $("#resetBtn").click(function(){
		 $("#invokeOnput").val("");
		 paramterInput:$("#paramterInput").val("");
	 });
	 
	 $("#urlBtn").click(function(){
		 var url = $("#serviceUrl").val()+"?&serviceName="+$("#serviceName").val()+"&methodName="+$("#methodName").val()+"&paramterInput="+$("#paramterInput").val();
		 $("#url_content").val(encodeURI(url));
	 });
	 
});

</script>
 <body>
 <div class="title">Service Test</div>
	<div class="main">
  <table width=100%  border=1  cellpadding="5" cellspacing="0" bordercolorlight="#cccccc" bordercolordark="#FFFFFF">
  <tr>
	<td width=10%>Service Name</td>
	<td width=45%>
	<input type="hidden" id="serviceUrl" style="width:80%;height:100%" value="${request.contextPath}/datashow/service">
	<input type="hidden" id="loadUrl" style="width:80%;height:100%" value="${request.contextPath}/datashow/load">
	<input type="text" id="serviceName" style="width:80%;height:100%" value="commodityPricePredictService">
	</td>
	<td width=45%  rowspan="2"  align="center"  >Output</td>
  </tr>
   <tr>
	<td>Method Name</td>
	<td>
	   <input type="text" id="methodName" style="width:80%;height:100%" value="newTotal"><input type="button" value=" 加载参数  " id="loadBtn">
	</td>
	
  </tr>
  <tr>
	<td>Paramter Input<br>(JSON)</td>
	<td height=450px><textarea id="paramterInput"  row="100" style="width:100%;height:100%">
		{

"total":100
}
	
	
	</textarea></td>
	<td  width=40%>
	    <textarea id="invokeOnput"  row="100" style="width:100%;height:100%"></textarea>
	</td>
  </tr>
  <tr>
      <td>URL</td>
	  <td colspan=2><textarea id="url_content"  row="100" style="width:100%;height:100%"></textarea></td>
  </tr>
   <tr>
	  <td align="center" colspan=3><input type="button" value=" 提交 " id="submitBtn"><input type="button" value=" 重置  " id="resetBtn"><input type="button" value=" 构造URL  " id="urlBtn"></td>
  </tr>
  
  </table>
 </div>
 </body>
</html>
